import type { SkuStock } from './SkuStock'
import type { PageDto } from './request'

type VerifyStatus = 0 | 1 // 0->未审核；1->审核通过
type ServiceIds = 1 | 2 | 3 // 1->无忧退货；2->快速退款；3->免费包邮
type RecommandStatus = 0 | 1 // 0->不推荐；1->推荐
type PublishStatus = 0 | 1 // 0->下架；1->上架
type PromotionType = 0 | 1 | 2 | 3 | 4 | 5 // 0->没有促销使用原价;1->使用促销价；2->使用会员价；3->使用阶梯价格；4->使用满减价格；5->限时购

export interface Product {
  albumPics?: string
  brandId?: number
  brandName?: string
  deleteStatus?: number
  description?: string
  detailDesc?: string
  detailHtml?: string
  detailMobileHtml?: string
  detailTitle?: string
  feightTemplateId?: number
  giftGrowth?: number
  giftPoint?: number
  id?: number
  keywords?: string
  lowStock?: number
  name?: string
  newStatus?: number
  note?: string
  originalPrice?: number
  pic?: string
  previewStatus?: number
  price?: number
  productAttributeCategoryId?: number
  productCategoryId?: number
  productCategoryName?: string
  productSn?: string
  promotionEndTime?: string
  promotionPerLimit?: number
  promotionPrice?: number
  promotionStartTime?: string
  promotionType?: PromotionType
  publishStatus?: PublishStatus
  recommandStatus?: RecommandStatus
  sale?: number
  serviceIds?: ServiceIds
  sort?: number
  stock?: number
  subTitle?: string
  unit?: string
  usePointLimit?: number
  verifyStatus?: VerifyStatus
  weight?: number
}

export interface ProductDetail extends Product {
  memberPriceList?: MemberPrice[]
  prefrenceAreaProductRelationList?: PrefrenceAreaProductRelation[]
  productAttributeValueList?: ProductAttributeValue[]
  productFullReductionList?: ProductFullReduction[]
  productLadderList?: ProductLadder[]
  skuStockList?: SkuStock[]
  subjectProductRelationList?: SubjectProductRelation[]
}

export interface MemberPrice {
  id?: number
  memberLevelId?: number
  memberLevelName?: string
  memberPrice?: number
  productId?: number
}

export interface PrefrenceAreaProductRelation {
  id?: number
  prefrenceAreaId?: number
  productId?: number
}

export interface ProductAttributeValue {
  id?: number
  productAttributeId?: number
  productId?: number
  value?: string
}

export interface ProductAttrValue {
  fullPrice?: number
  id?: number
  productId?: number
  reducePrice?: number
}

export interface ProductFullReduction {
  fullPrice?: number
  id?: number
  productId?: number
  reducePrice?: number
}

export interface ProductLadder {
  count?: number
  discount?: number
  id?: number
  price?: number
  productId?: number
}

export interface SubjectProductRelation {
  id?: number
  productId?: number
  subjectId?: number
}

export interface ProductParams {
  albumPics?: string
  brandId?: number
  brandName?: string
  deleteStatus?: number
  description?: string
  detailDesc?: string
  detailHtml?: string
  detailMobileHtml?: string
  detailTitle?: string
  feightTemplateId?: number
  giftGrowth?: number
  giftPoint?: number
  id?: number
  keywords?: string
  lowStock?: number
  memberPriceList?: MemberPrice[]
  name?: string
  newStatus?: number
  note?: string
  originalPrice?: number
  pic?: string
  prefrenceAreaProductRelationList?: PrefrenceAreaProductRelation[]
  previewStatus?: number
  price?: number
  productAttributeCategoryId?: number
  productAttributeValueList?: ProductAttributeValue[]
  productCategoryId?: number
  productCategoryName?: string
  productFullReductionList?: ProductFullReduction[]
  productLadderList?: ProductLadder[]
  productSn?: string
  promotionEndTime?: string
  promotionPerLimit?: number
  promotionPrice?: number
  promotionStartTime?: string
  promotionType?: PromotionType
  publishStatus?: number
  recommandStatus?: RecommandStatus
  sale?: number
  serviceIds?: ServiceIds
  skuStockList?: SkuStock[]
  sort?: number
  stock?: number
  subTitle?: string
  subjectProductRelationList?: SubjectProductRelation[]
  unit?: string
  usePointLimit?: number
  verifyStatus?: VerifyStatus
  weight?: number
}

export interface ProductPageParams extends PageDto {
  brandId?: number
  keyword?: string
  productCategoryId?: number
  productSn?: string
  publishStatus?: number
  verifyStatus?: number
}
export interface ProductUpdateStatusParams {
  id: number
  verifyStatus: number
  detail: string
}

export interface ProductRelation {
  couponId?: number
  id?: number
  productId?: number
  productName?: string
  productSn?: string
}
export interface ProductCategoryRelation {
  couponId?: number
  id?: number
  parentCategoryName?: string
  productCategoryId?: number
  productCategoryName?: string
}
